﻿using Microsoft.Extensions.Configuration;

namespace Leo.Core.HttpApi.Host.Options
{
    public static class OptionReaderExtention
    {
        public static TOption GetOptionByName<TOption>(this IConfiguration configuration,
            string name) where TOption : new()
        {
            var option = new TOption();
            configuration.Bind(name, option);
            return option;
        }
    }
}
